<!DOCTYPE html>
<html>

{include file='public/header'}
<style>
    .layui-input-block{margin-left: 90px;}
    .layui-table-cell {
        height: auto;
        line-height: 30px;
        text-align: left;
    }
</style>
<body>
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="javascript:void(0)">首页</a>
            <a href="javascript:void(0)">财务中心</a>
            <a><cite>虚拟支付提现申请</cite></a>
        </span>
        <a class="layui-btn layui-btn-small" id="reload" title="刷新">
            <i class="layui-icon" style="line-height:30px"><i class="iconfont">&#xe6aa;</i></i>
        </a>
    </div>
    <div class="x-body">
        <form class="layui-form layui-row" style="margin-top:15px;margin-bottom: 10px;">
            <div class="layui-inline">
                <label class="layui-form-label w-auto">小程序名称：</label>
                <div id="app_id" class="layui-input-inline"></div>
            </div>
            <div class="layui-inline" style="margin-left:10px">
                <button class="layui-btn" lay-submit lay-filter="searchList">搜索</button>
                <button type="reset" id="resetList" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </form>

        <table id="withdraw_order_records" lay-filter="withdraw_order_records"></table>
    </div>
    <script type="text/html" id="toolbarDemo">
        <div class="layui-btn-container">
            <button class="layui-btn layui-btn-sm" lay-event="add">申请提现</button>
        </div>
    </script>
    <script type="text/html" id="tbBar">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <script>
        let params = {
            elem: '#withdraw_order_records'
            , toolbar: '#toolbarDemo'
            , url: '/admin/finance/virtualWithdrawOrderList' //数据接口
            , id: 'withdraw_order_records'
            , limit:15
            ,page:true
            , cols: [[ //表头
                { field: 'id', title: 'ID', width: 80, sort: true, align:'center', width:90}
                ,{ field: 'applet_name', title: '小程序名称',  width:200, align:'center', templet: function (d) {
                        return d.applet.name;
                    }
                }
                , { field: 'withdraw_no', title: '提现单单号', align:'center', width:220}
                , { field: 'wx_withdraw_no', title: '提现单的微信侧单号', align:'center', width:220}
                , { field: 'withdraw_amount', title: '提现的金额', align:'center', width:100}
                , { field: 'status_text', title: '状态', align:'center', width:100}
                , { field: 'fail_reason', title: '提现失败的原因', align:'center', width:180}
                ,{ field: 'operator_name', title: '操作人员',  width:100, align:'center', templet: function (d) {
                        return d.admin.name;
                    }
                }
                , { field: 'created_at', title: '创建时间', align:'center'}
            ]]
        }
        tableList(params)

        layui.use('table', function () {
            var table = layui.table;
            table.on('toolbar(withdraw_order_records)', function (obj) {
                var event = obj.event;
                if (event === 'add') {
                    x_admin_show('申请提现', './withdraw.html', 650, 600);
                }
            });
        });

        let selectApplet = {
            url: '/admin/applet/select',
            selected: [],
            tips: '请选择',
            name: 'app_id',
            field_id: 'id',
            field_Name: 'name',
            elem: '#app_id'
        }
        selectN(selectApplet)

    </script>
</body>

</html>